#ifndef WORKTHREAD_H
#define WORKTHREAD_H

#include <QThread>

class workthread : public QThread
{
    Q_OBJECT
public:
    workthread();
    int htoi(char s[]);
    int init_serial();
    int write_data(int fd, void *buf, int len);
    int read_data(int fd, void *buf, int len);
    int test(int fd,QString& xldl,QString& jddz,QString& jnjg);

    void run();

signals:
    void MsgSignal(const QString& temp);//用于向主线程传递字符串

private:
    QString m_data;
    QString naiyaDetails; //交耐结果
    QString dianzuDetails; //接地电阻
    QString loudianDetails;  //泄露电流
    int m_fd;                       //串口文件表示符

public slots:
    void receiveData(QString data);//用于接收界面传来的数据
    void slot_stopTest();           //用于中断某次测试
};

#endif // WORKTHREAD_H
